package com.xuzz.study.spring.factorybean;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class PersonFactoryBeanConfig {
    //FactoryBean是一个特殊的bean，也需要被spring托管。
    //如果是在xml环境下，也就是要定义<bean .....
    //或者通过NamespaceHandler来生成BeanDefinition
    @Bean
    public PersonFactoryBean personFactoryBean()
    {
        return new PersonFactoryBean();
    }

    @Bean
    public PersonService personService()
    {
        return new PersonService();
    }

    public  void say()
    {
        System.out.println("hhaaa");
    }
}
